package kr.pe.johnkim.carrotpoint.mobile.service;

import kr.pe.johnkim.carrotpoint.mobile.dao.CarrotPointBusinessKindDao;
import kr.pe.johnkim.carrotpoint.mobile.domain.CarrotPointBusinessKind;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Carrot Point 가맹점 업종 관련 service 클래스 이다.
 *
 * @author : John_Kim <cale9797@gmail.com>
 * @date : 13. 2. 6.
 */
@Service
public class CarrotPointBusinessKindServiceImpl implements CarrotPointBusinessKindService {

    // SLF4J Logging
    private Logger logger = LoggerFactory.getLogger(CarrotPointBusinessKindServiceImpl.class);

    @Autowired
    private CarrotPointBusinessKindDao carrotPointBusinessKindDao;

    /**
     * 가맹점 업종을 등록 한다.
     *
     * @param carrotPointBusinessKind
     */
    @Override
    public void registerBusinessKind(CarrotPointBusinessKind carrotPointBusinessKind) {
        logger.info("registerBusinessKind");
        carrotPointBusinessKindDao.registerBusinessKind(carrotPointBusinessKind);
    }

    /**
     * 가맹점 업종 목록을 가져 온다.
     *
     * @param carrotPointBusinessKind
     * @return
     */
    @Override
    public List<CarrotPointBusinessKind> getBusinessKindList(CarrotPointBusinessKind carrotPointBusinessKind) {
        logger.info("getBusinessKindList");
        return carrotPointBusinessKindDao.getBusinessKindList(carrotPointBusinessKind);
    }

    /**
     * 가맹점 업종 내용을 업데이트 한다.
     *
     * @param carrotPointBusinessKind
     */
    @Override
    public void updateBusinessKind(CarrotPointBusinessKind carrotPointBusinessKind) {
        logger.info("updateBusinessKind");
        carrotPointBusinessKindDao.updateBusinessKind(carrotPointBusinessKind);
    }

    /**
     * 가맹점 업종 활성화 여부를 업데이트 한다.
     *
     * @param carrotPointBusinessKind
     */
    @Override
    public void updateBusinessKindActivateYn(CarrotPointBusinessKind carrotPointBusinessKind) {
        logger.info("updateBusinessKindActivateYn");
        carrotPointBusinessKindDao.updateBusinessKindActivateYn(carrotPointBusinessKind);
    }
}
